package com.hust.bridgecheck.controller.ReportManagement;

import com.hust.bridgecheck.entity.DailySensorData;
import com.hust.bridgecheck.service.Settings.NotifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

@RestController
@RequestMapping("report")
public class ReportController {

    @Autowired
    private NotifyService notifyService;

    @PostMapping("/getReportByFlag")
    public List<DailySensorData> getReportByFlag(@RequestParam("flag") Integer Flag,@RequestParam("startime") String Startime,@RequestParam("endtime") String Endtime){
        return notifyService.getAllReport(Flag,Startime,Endtime);
    }

}
